arm: implement event injection
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 1 Jun 2012 09:20:35 +0000 (10:20 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 1 Jun 2012 09:20:35 +0000 (10:20 +0100)
commitc626aa1a5aa574faf746ca1006a13bc16b9af1a0
tree56f7c9519e8ce807470e9fda1b5f63c00c09f999
parent19c953f511aebf5d2298dfe3f1effd5fadcb1005
arm: implement event injection

Implement vcpu_mark_events_pending using the vgic to inject PPI 31, that
we reserve for Xen usage.
In the future the interrupt used for event injection might be dynamic
and could be written into the device tree.
Otherwise it could be an SGI choosen by the guest and passed to Xen
through an hypercall.

Considering that:

- it is easy to determine if an event notification
interrupt has already been EOI'd by the guest just looking at the
evtchn_upcall_pending bit in the shared_info page;

- we can safely assume that there is at most one event notification
interrupt pending at any time in any set of LR registers because we
never inject more than a single event notification interrupt in one vcpu
(see vcpu_mark_events_pending);

we can avoid requesting maintenance interrupts for
VGIC_IRQ_EVTCHN_CALLBACK, provided that we check for event notification
interrupts that need to be cleared in the following places:

- maintenance interrupt entry;

- gic_set_guest_irq;

that is every time we are about to write to an LR.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/domain.c
xen/arch/arm/dummy.S
xen/arch/arm/gic.c
xen/arch/arm/gic.h